package com.example.service;

import com.example.mapper.MessageInfoMapper;
import com.example.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {

    @Autowired
    private MessageInfoMapper messageInfoMapper;

    /**
     * 添加留言，调用数据层接口
     * @param messageInfo
     * @return
     */
    public Integer addMessage(MessageInfo messageInfo) {

       return messageInfoMapper.insertMessage(messageInfo);
    }

    /**
     * 查询留言，调用数据层接口
     * @return
     */
    public List<MessageInfo> getMessageList() {
        return messageInfoMapper.selectAllList();
    }
}
